import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_app/NormalNumber.dart';
import 'package:flutter_app/NumberButtonLine.dart';

class CalculatorPage extends StatefulWidget {
  String title;

  CalculatorPage({Key key, this.title}) : super(key: key);

  @override
  _CalculatorPageState createState() => new _CalculatorPageState();
}

class _CalculatorPageState extends State<CalculatorPage> {
  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      appBar: new AppBar(
        title: new Center(
          child: new Text(
            widget.title,
            style:
                new TextStyle(color: Colors.white, fontStyle: FontStyle.italic),
          ),
        ),
      ),
      body: new Container(
        color: Colors.white,
        child: Column(
          children: <Widget>[
            Expanded(
              key: Key('number_button_line_1'),
              child: new NumberButtonLine(
                array: [
                  NormalNumber('1'),
                  NormalNumber('2'),
                  NormalNumber('3'),
                ],
              ),
            ),
            Expanded(
              key: Key('number_button_line_2'),
              child: new NumberButtonLine(array: [
                NormalNumber('4'),
                NormalNumber('5'),
                NormalNumber('6'),
              ]),
            ),
            Expanded(
              key: Key('number_button_line_3'),
              child: new NumberButtonLine(array: [
                NormalNumber('7'),
                NormalNumber('8'),
                NormalNumber('9'),
              ]),
            ),
          ],
        ),
      ),
    );
  }
}
